package com.vdong.common.oauth.entity.mo;

import com.google.common.base.Strings;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;


import javax.persistence.Table;
import java.io.Serializable;

/**
 * 店铺信息
 *
 * @author llh
 * Created on 2018/06/12.
 */
@Data
@Table(name = "store_info")
public class AppStoreInfoMO implements Serializable {
    @Id
    private Long id;
    @ApiModelProperty("店铺名称")
    private String name;
    @ApiModelProperty("店铺logo")
    private String logoUrl;
    @ApiModelProperty("店铺简介")
    private String information;
    @ApiModelProperty("店铺编号")
    private String storeNumber;
    @ApiModelProperty("空间域名")
    private String bucketDomain;
    /**
     *  // 店铺存储空间
     */
    private String bucketName;
    @ApiModelProperty("虚拟支付限制")
    private Boolean payCtrl;
    @ApiModelProperty("客服电话")
    private String customerPhone;

    /**
     * 获取店铺前缀
     */
    public String getStorePrefix() {
        if (Strings.isNullOrEmpty(storeNumber)) {
            return "";
        }
        return storeNumber.substring(storeNumber.length() - 3);
    }

}

